import axios from 'axios';
import Cookies from 'js-cookie';

export function post (url, param, config) {
    return axios.post(url, param, config || {});
}
export function postT (url, param) {
    return axios.post(url, param, {
        headers: {
            token: Cookies.get('NCCLOUD_TOKEN')
        }
    });
}
export function postFormData (url, formdata) {
    return axios.post(url, formdata, {
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}

export function postSeafile (url, headers, param) {
    return axios.post(url, param, {
        headers: {
            Authorization: 'Token ' + headers.token
        }
    });
}

export function postFormDataSeafile (url, headers, param) {
    return axios.post(url, param, {
        headers: {
            Authorization: 'Token ' + headers.token,
            'Content-Type': 'multipart/form-data'
        }
    });
}
